﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>CallAndApply3</title>
</head>
<body>
    <script type="text/javascript">
        var Class = {
            create: function ()              // create Function  
            {
                return function () {
                    this.initialize.apply(this, arguments);
                }
            }
        };

        var Person = Class.create();        // Create Class Person  
        Person.prototype = {                // prototype initialize  
            initialize: function (obj1, obj2) {
                this.obj1 = obj1;
                this.obj2 = obj2;
            },
            showSelf: function () {
                alert("obj: " + this.obj1 + " and " + this.obj2);
            }
        }

        // instance Class  
        var person = new Person("man", "women");    // two params  
        person.showSelf();                          // show person  
    </script>
</body>
</html>
